package com.xw.lianshou.ieke;

/**
 * 测试 ++
 * count = count++; 先将count(值为0) 赋值给count 在执行++操作
 * count永远为0
 * +运算符 优先级比 = 高
 * @author xw
 * @date 2021/5/30 23:39
 */
public class Demo1 {
    public static void main(String[] args) {
        int count = 0;
        int num = 0;
        for (int i = 0; i < 100; i++) {
            num = num + i;
            // count永远都是0
            count = count++;
            // count是100
//            count = ++count;
            // count是100
//            count++;
            // count是100
//            count = count + 1;
            // count是0
//            count = count--;
        }
        System.out.println("num="+ num);
        System.out.println("count="+ count);
        System.out.println("num * count = " + (num * count));
    }
}
